.class public Lcom/hierynomus/protocol/commons/buffer/Buffer;
.super Ljava/lang/Object;
.source "Buffer.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/hierynomus/protocol/commons/buffer/Buffer$b;,
        Lcom/hierynomus/protocol/commons/buffer/Buffer$BufferException;
    }
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "<T:",
        "Lcom/hierynomus/protocol/commons/buffer/Buffer<",
        "TT;>;>",
        "Ljava/lang/Object;"
    }
.end annotation


# instance fields
.field protected a:[B

.field private b:Lcom/hierynomus/protocol/commons/buffer/a;

.field protected c:I

.field protected d:I


# direct methods
.method public constructor <init>(ILcom/hierynomus/protocol/commons/buffer/a;)V
    .locals 1

    .line 3
    invoke-static {p1}, Lcom/hierynomus/protocol/commons/buffer/Buffer;->h(I)I

    move-result p1

    new-array p1, p1, [B

    const/4 v0, 0x0

    invoke-direct {p0, p1, v0, p2}, Lcom/hierynomus/protocol/commons/buffer/Buffer;-><init>([BZLcom/hierynomus/protocol/commons/buffer/a;)V

    return-void
.end method

.method public constructor <init>(Lcom/hierynomus/protocol/commons/buffer/a;)V
    .locals 1

    const/16 v0, 0x100

    .line 1
    invoke-direct {p0, v0, p1}, Lcom/hierynomus/protocol/commons/buffer/Buffer;-><init>(ILcom/hierynomus/protocol/commons/buffer/a;)V

    return-void
.end method

.method public constructor <init>([BLcom/hierynomus/protocol/commons/buffer/a;)V
    .locals 1

    const/4 v0, 0x1

    .line 2
    invoke-direct {p0, p1, v0, p2}, Lcom/hierynomus/protocol/commons/buffer/Buffer;-><init>([BZLcom/hierynomus/protocol/commons/buffer/a;)V

    return-void
.end method

.method private constructor <init>([BZLcom/hierynomus/protocol/commons/buffer/a;)V
    .locals 0

    .line 4
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 5
    iput-object p1, p0, Lcom/hierynomus/protocol/commons/buffer/Buffer;->a:[B

    .line 6
    iput-object p3, p0, Lcom/hierynomus/protocol/commons/buffer/Buffer;->b:Lcom/hierynomus/protocol/commons/buffer/a;

    const/4 p3, 0x0

    .line 7
    iput p3, p0, Lcom/hierynomus/protocol/commons/buffer/Buffer;->c:I

    if-eqz p2, :cond_0

    .line 8
    array-length p3, p1

    :cond_0
    iput p3, p0, Lcom/hierynomus/protocol/commons/buffer/Buffer;->d:I

    return-void
.end method

.method private a(Ljava/lang/String;Ljava/nio/charset/Charset;Lcom/hierynomus/protocol/commons/buffer/a;)Lcom/hierynomus/protocol/commons/buffer/Buffer;
    .locals 5
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/String;",
            "Ljava/nio/charset/Charset;",
            "Lcom/hierynomus/protocol/commons/buffer/a;",
            ")",
            "Lcom/hierynomus/protocol/commons/buffer/Buffer<",
            "TT;>;"
        }
    .end annotation

    .line 26
    invoke-virtual {p2}, Ljava/nio/charset/Charset;->name()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/String;->hashCode()I

    move-result v1

    const/4 v2, 0x3

    const/4 v3, 0x2

    const/4 v4, 0x1

    sparse-switch v1, :sswitch_data_0

    goto :goto_0

    :sswitch_0
    const-string v1, "UTF-16LE"

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_0

    const/4 v0, 0x1

    goto :goto_1

    :sswitch_1
    const-string v1, "UTF-16BE"

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_0

    const/4 v0, 0x2

    goto :goto_1

    :sswitch_2
    const-string v1, "UTF-8"

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_0

    const/4 v0, 0x3

    goto :goto_1

    :sswitch_3
    const-string v1, "UTF-16"

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_0

    const/4 v0, 0x0

    goto :goto_1

    :cond_0
    :goto_0
    const/4 v0, -0x1

    :goto_1
    if-eqz v0, :cond_4

    if-eq v0, v4, :cond_3

    if-eq v0, v3, :cond_2

    if-ne v0, v2, :cond_1

    .line 27
    invoke-virtual {p1, p2}, Ljava/lang/String;->getBytes(Ljava/nio/charset/Charset;)[B

    move-result-object p1

    .line 28
    invoke-virtual {p0, p1}, Lcom/hierynomus/protocol/commons/buffer/Buffer;->a([B)Lcom/hierynomus/protocol/commons/buffer/Buffer;

    goto :goto_2

    .line 29
    :cond_1
    new-instance p1, Ljava/nio/charset/UnsupportedCharsetException;

    invoke-virtual {p2}, Ljava/nio/charset/Charset;->name()Ljava/lang/String;

    move-result-object p2

    invoke-direct {p1, p2}, Ljava/nio/charset/UnsupportedCharsetException;-><init>(Ljava/lang/String;)V

    throw p1

    .line 30
    :cond_2
    sget-object p2, Lcom/hierynomus/protocol/commons/buffer/a;->b:Lcom/hierynomus/protocol/commons/buffer/a;

    invoke-virtual {p2, p0, p1}, Lcom/hierynomus/protocol/commons/buffer/a;->a(Lcom/hierynomus/protocol/commons/buffer/Buffer;Ljava/lang/String;)V

    goto :goto_2

    .line 31
    :cond_3
    sget-object p2, Lcom/hierynomus/protocol/commons/buffer/a;->a:Lcom/hierynomus/protocol/commons/buffer/a;

    invoke-virtual {p2, p0, p1}, Lcom/hierynomus/protocol/commons/buffer/a;->a(Lcom/hierynomus/protocol/commons/buffer/Buffer;Ljava/lang/String;)V

    goto :goto_2

    .line 32
    :cond_4
    invoke-virtual {p3, p0, p1}, Lcom/hierynomus/protocol/commons/buffer/a;->a(Lcom/hierynomus/protocol/commons/buffer/Buffer;Ljava/lang/String;)V

    :goto_2
    return-object p0

    :sswitch_data_0
    .sparse-switch
        -0x6a33dbd5 -> :sswitch_3
        0x4d50972 -> :sswitch_2
        0x5353cdae -> :sswitch_1
        0x5353cee4 -> :sswitch_0
    .end sparse-switch
.end method

.method private a(Ljava/nio/charset/Charset;ILcom/hierynomus/protocol/commons/buffer/a;)Ljava/lang/String;
    .locals 5
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lcom/hierynomus/protocol/commons/buffer/Buffer$BufferException;
        }
    .end annotation

    .line 19
    invoke-virtual {p1}, Ljava/nio/charset/Charset;->name()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/String;->hashCode()I

    move-result v1

    const/4 v2, 0x3

    const/4 v3, 0x2

    const/4 v4, 0x1

    sparse-switch v1, :sswitch_data_0

    goto :goto_0

    :sswitch_0
    const-string v1, "UTF-16LE"

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_0

    const/4 v0, 0x1

    goto :goto_1

    :sswitch_1
    const-string v1, "UTF-16BE"

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_0

    const/4 v0, 0x2

    goto :goto_1

    :sswitch_2
    const-string v1, "UTF-8"

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_0

    const/4 v0, 0x3

    goto :goto_1

    :sswitch_3
    const-string v1, "UTF-16"

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_0

    const/4 v0, 0x0

    goto :goto_1

    :cond_0
    :goto_0
    const/4 v0, -0x1

    :goto_1
    if-eqz v0, :cond_4

    if-eq v0, v4, :cond_3

    if-eq v0, v3, :cond_2

    if-ne v0, v2, :cond_1

    .line 20
    new-instance p3, Ljava/lang/String;

    invoke-virtual {p0, p2}, Lcom/hierynomus/protocol/commons/buffer/Buffer;->e(I)[B

    move-result-object p2

    invoke-direct {p3, p2, p1}, Ljava/lang/String;-><init>([BLjava/nio/charset/Charset;)V

    return-object p3

    .line 21
    :cond_1
    new-instance p2, Ljava/nio/charset/UnsupportedCharsetException;

    invoke-virtual {p1}, Ljava/nio/charset/Charset;->name()Ljava/lang/String;

    move-result-object p1

    invoke-direct {p2, p1}, Ljava/nio/charset/UnsupportedCharsetException;-><init>(Ljava/lang/String;)V

    throw p2

    .line 22
    :cond_2
    sget-object p1, Lcom/hierynomus/protocol/commons/buffer/a;->b:Lcom/hierynomus/protocol/commons/buffer/a;

    invoke-virtual {p1, p0, p2}, Lcom/hierynomus/protocol/commons/buffer/a;->a(Lcom/hierynomus/protocol/commons/buffer/Buffer;I)Ljava/lang/String;

    move-result-object p1

    return-object p1

    .line 23
    :cond_3
    sget-object p1, Lcom/hierynomus/protocol/commons/buffer/a;->a:Lcom/hierynomus/protocol/commons/buffer/a;

    invoke-virtual {p1, p0, p2}, Lcom/hierynomus/protocol/commons/buffer/a;->a(Lcom/hierynomus/protocol/commons/buffer/Buffer;I)Ljava/lang/String;

    move-result-object p1

    return-object p1

    .line 24
    :cond_4
    invoke-virtual {p3, p0, p2}, Lcom/hierynomus/protocol/commons/buffer/a;->a(Lcom/hierynomus/protocol/commons/buffer/Buffer;I)Ljava/lang/String;

    move-result-object p1

    return-object p1

    nop

    :sswitch_data_0
    .sparse-switch
        -0x6a33dbd5 -> :sswitch_3
        0x4d50972 -> :sswitch_2
        0x5353cdae -> :sswitch_1
        0x5353cee4 -> :sswitch_0
    .end sparse-switch
.end method

.method protected static h(I)I
    .locals 3

    const/4 v0, 0x1

    :goto_0
    if-ge v0, p0, :cond_1

    shl-int/lit8 v0, v0, 0x1

    if-lez v0, :cond_0

    goto :goto_0

    .line 1
    :cond_0
    new-instance v0, Ljava/lang/IllegalArgumentException;

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "Cannot get next power of 2; "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v1, p0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    const-string p0, " is too large"

    invoke-virtual {v1, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object p0

    invoke-direct {v0, p0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v0

    :cond_1
    return v0
.end method


# virtual methods
.method public a(Lcom/hierynomus/protocol/commons/buffer/a;)J
    .locals 2
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lcom/hierynomus/protocol/commons/buffer/Buffer$BufferException;
        }
    .end annotation

    .line 17
    invoke-virtual {p1, p0}, Lcom/hierynomus/protocol/commons/buffer/a;->a(Lcom/hierynomus/protocol/commons/buffer/Buffer;)J

    move-result-wide v0

    return-wide v0
.end method

.method public a(B)Lcom/hierynomus/protocol/commons/buffer/Buffer;
    .locals 3
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(B)",
            "Lcom/hierynomus/protocol/commons/buffer/Buffer<",
            "TT;>;"
        }
    .end annotation

    const/4 v0, 0x1

    .line 4
    invoke-virtual {p0, v0}, Lcom/hierynomus/protocol/commons/buffer/Buffer;->b(I)V

    .line 5
    iget-object v0, p0, Lcom/hierynomus/protocol/commons/buffer/Buffer;->a:[B

    iget v1, p0, Lcom/hierynomus/protocol/commons/buffer/Buffer;->d:I

    add-int/lit8 v2, v1, 0x1

    iput v2, p0, Lcom/hierynomus/protocol/commons/buffer/Buffer;->d:I

    aput-byte p1, v0, v1

    return-object p0
.end method

.method public a(ILcom/hierynomus/protocol/commons/buffer/a;)Lcom/hierynomus/protocol/commons/buffer/Buffer;
    .locals 0
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(I",
            "Lcom/hierynomus/protocol/commons/buffer/a;",
            ")",
            "Lcom/hierynomus/protocol/commons/buffer/Buffer<",
            "TT;>;"
        }
    .end annotation

    .line 14
    invoke-virtual {p2, p0, p1}, Lcom/hierynomus/protocol/commons/buffer/a;->b(Lcom/hierynomus/protocol/commons/buffer/Buffer;I)V

    return-object p0
.end method

.method public a(J)Lcom/hierynomus/protocol/commons/buffer/Buffer;
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(J)",
            "Lcom/hierynomus/protocol/commons/buffer/Buffer<",
            "TT;>;"
        }
    .end annotation

    .line 15
    iget-object v0, p0, Lcom/hierynomus/protocol/commons/buffer/Buffer;->b:Lcom/hierynomus/protocol/commons/buffer/a;

    invoke-virtual {p0, p1, p2, v0}, Lcom/hierynomus/protocol/commons/buffer/Buffer;->a(JLcom/hierynomus/protocol/commons/buffer/a;)Lcom/hierynomus/protocol/commons/buffer/Buffer;

    return-object p0
.end method

.method public a(JLcom/hierynomus/protocol/commons/buffer/a;)Lcom/hierynomus/protocol/commons/buffer/Buffer;
    .locals 0
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(J",
            "Lcom/hierynomus/protocol/commons/buffer/a;",
            ")",
            "Lcom/hierynomus/protocol/commons/buffer/Buffer<",
            "TT;>;"
        }
    .end annotation

    .line 16
    invoke-virtual {p3, p0, p1, p2}, Lcom/hierynomus/protocol/commons/buffer/a;->a(Lcom/hierynomus/protocol/commons/buffer/Buffer;J)V

    return-object p0
.end method

.method public a(Lcom/hierynomus/protocol/commons/buffer/Buffer;)Lcom/hierynomus/protocol/commons/buffer/Buffer;
    .locals 4
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lcom/hierynomus/protocol/commons/buffer/Buffer<",
            "+",
            "Lcom/hierynomus/protocol/commons/buffer/Buffer<",
            "*>;>;)",
            "Lcom/hierynomus/protocol/commons/buffer/Buffer<",
            "TT;>;"
        }
    .end annotation

    if-eqz p1, :cond_0

    .line 10
    invoke-virtual {p1}, Lcom/hierynomus/protocol/commons/buffer/Buffer;->c()I

    move-result v0

    .line 11
    invoke-virtual {p0, v0}, Lcom/hierynomus/protocol/commons/buffer/Buffer;->b(I)V

    .line 12
    iget-object v1, p1, Lcom/hierynomus/protocol/commons/buffer/Buffer;->a:[B

    iget p1, p1, Lcom/hierynomus/protocol/commons/buffer/Buffer;->c:I

    iget-object v2, p0, Lcom/hierynomus/protocol/commons/buffer/Buffer;->a:[B

    iget v3, p0, Lcom/hierynomus/protocol/commons/buffer/Buffer;->d:I

    invoke-static {v1, p1, v2, v3, v0}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V

    .line 13
    iget p1, p0, Lcom/hierynomus/protocol/commons/buffer/Buffer;->d:I

    add-int/2addr p1, v0

    iput p1, p0, Lcom/hierynomus/protocol/commons/buffer/Buffer;->d:I

    :cond_0
    return-object p0
.end method

.method public a(Ljava/lang/String;Ljava/nio/charset/Charset;)Lcom/hierynomus/protocol/commons/buffer/Buffer;
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/String;",
            "Ljava/nio/charset/Charset;",
            ")",
            "Lcom/hierynomus/protocol/commons/buffer/Buffer<",
            "TT;>;"
        }
    .end annotation

    .line 25
    iget-object v0, p0, Lcom/hierynomus/protocol/commons/buffer/Buffer;->b:Lcom/hierynomus/protocol/commons/buffer/a;

    invoke-direct {p0, p1, p2, v0}, Lcom/hierynomus/protocol/commons/buffer/Buffer;->a(Ljava/lang/String;Ljava/nio/charset/Charset;Lcom/hierynomus/protocol/commons/buffer/a;)Lcom/hierynomus/protocol/commons/buffer/Buffer;

    return-object p0
.end method

.method public a([B)Lcom/hierynomus/protocol/commons/buffer/Buffer;
    .locals 2
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "([B)",
            "Lcom/hierynomus/protocol/commons/buffer/Buffer<",
            "TT;>;"
        }
    .end annotation

    .line 6
    array-length v0, p1

    const/4 v1, 0x0

    invoke-virtual {p0, p1, v1, v0}, Lcom/hierynomus/protocol/commons/buffer/Buffer;->a([BII)Lcom/hierynomus/protocol/commons/buffer/Buffer;

    return-object p0
.end method

.method public a([BII)Lcom/hierynomus/protocol/commons/buffer/Buffer;
    .locals 2
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "([BII)",
            "Lcom/hierynomus/protocol/commons/buffer/Buffer<",
            "TT;>;"
        }
    .end annotation

    .line 7
    invoke-virtual {p0, p3}, Lcom/hierynomus/protocol/commons/buffer/Buffer;->b(I)V

    .line 8
    iget-object v0, p0, Lcom/hierynomus/protocol/commons/buffer/Buffer;->a:[B

    iget v1, p0, Lcom/hierynomus/protocol/commons/buffer/Buffer;->d:I

    invoke-static {p1, p2, v0, v1, p3}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V

    .line 9
    iget p1, p0, Lcom/hierynomus/protocol/commons/buffer/Buffer;->d:I

    add-int/2addr p1, p3

    iput p1, p0, Lcom/hierynomus/protocol/commons/buffer/Buffer;->d:I

    return-object p0
.end method

.method public a(Ljava/nio/charset/Charset;I)Ljava/lang/String;
    .locals 1
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lcom/hierynomus/protocol/commons/buffer/Buffer$BufferException;
        }
    .end annotation

    .line 18
    iget-object v0, p0, Lcom/hierynomus/protocol/commons/buffer/Buffer;->b:Lcom/hierynomus/protocol/commons/buffer/a;

    invoke-direct {p0, p1, p2, v0}, Lcom/hierynomus/protocol/commons/buffer/Buffer;->a(Ljava/nio/charset/Charset;ILcom/hierynomus/protocol/commons/buffer/a;)Ljava/lang/String;

    move-result-object p1

    return-object p1
.end method

.method protected a(I)V
    .locals 1
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lcom/hierynomus/protocol/commons/buffer/Buffer$BufferException;
        }
    .end annotation

    .line 2
    invoke-virtual {p0}, Lcom/hierynomus/protocol/commons/buffer/Buffer;->c()I

    move-result v0

    if-lt v0, p1, :cond_0

    return-void

    .line 3
    :cond_0
    new-instance p1, Lcom/hierynomus/protocol/commons/buffer/Buffer$BufferException;

    const-string v0, "Underflow"

    invoke-direct {p1, v0}, Lcom/hierynomus/protocol/commons/buffer/Buffer$BufferException;-><init>(Ljava/lang/String;)V

    throw p1
.end method

.method public a()[B
    .locals 1

    .line 1
    iget-object v0, p0, Lcom/hierynomus/protocol/commons/buffer/Buffer;->a:[B

    return-object v0
.end method

.method public b(Lcom/hierynomus/protocol/commons/buffer/a;)I
    .locals 0
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lcom/hierynomus/protocol/commons/buffer/Buffer$BufferException;
        }
    .end annotation

    .line 9
    invoke-virtual {p1, p0}, Lcom/hierynomus/protocol/commons/buffer/a;->b(Lcom/hierynomus/protocol/commons/buffer/Buffer;)I

    move-result p1

    return p1
.end method

.method public b(ILcom/hierynomus/protocol/commons/buffer/a;)Lcom/hierynomus/protocol/commons/buffer/Buffer;
    .locals 0
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(I",
            "Lcom/hierynomus/protocol/commons/buffer/a;",
            ")",
            "Lcom/hierynomus/protocol/commons/buffer/Buffer<",
            "TT;>;"
        }
    .end annotation

    .line 10
    invoke-virtual {p2, p0, p1}, Lcom/hierynomus/protocol/commons/buffer/a;->c(Lcom/hierynomus/protocol/commons/buffer/Buffer;I)V

    return-object p0
.end method

.method public b(J)Lcom/hierynomus/protocol/commons/buffer/Buffer;
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(J)",
            "Lcom/hierynomus/protocol/commons/buffer/Buffer<",
            "TT;>;"
        }
    .end annotation

    .line 11
    iget-object v0, p0, Lcom/hierynomus/protocol/commons/buffer/Buffer;->b:Lcom/hierynomus/protocol/commons/buffer/a;

    invoke-virtual {p0, p1, p2, v0}, Lcom/hierynomus/protocol/commons/buffer/Buffer;->b(JLcom/hierynomus/protocol/commons/buffer/a;)Lcom/hierynomus/protocol/commons/buffer/Buffer;

    return-object p0
.end method

.method public b(JLcom/hierynomus/protocol/commons/buffer/a;)Lcom/hierynomus/protocol/commons/buffer/Buffer;
    .locals 0
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(J",
            "Lcom/hierynomus/protocol/commons/buffer/a;",
            ")",
            "Lcom/hierynomus/protocol/commons/buffer/Buffer<",
            "TT;>;"
        }
    .end annotation

    .line 12
    invoke-virtual {p3, p0, p1, p2}, Lcom/hierynomus/protocol/commons/buffer/a;->b(Lcom/hierynomus/protocol/commons/buffer/Buffer;J)V

    return-object p0
.end method

.method public b()Ljava/io/InputStream;
    .locals 1

    .line 13
    new-instance v0, Lcom/hierynomus/protocol/commons/buffer/Buffer$a;

    invoke-direct {v0, p0}, Lcom/hierynomus/protocol/commons/buffer/Buffer$a;-><init>(Lcom/hierynomus/protocol/commons/buffer/Buffer;)V

    return-object v0
.end method

.method public b(I)V
    .locals 3

    .line 1
    iget-object v0, p0, Lcom/hierynomus/protocol/commons/buffer/Buffer;->a:[B

    array-length v0, v0

    iget v1, p0, Lcom/hierynomus/protocol/commons/buffer/Buffer;->d:I

    sub-int/2addr v0, v1

    if-ge v0, p1, :cond_0

    add-int/2addr v1, p1

    .line 2
    invoke-static {v1}, Lcom/hierynomus/protocol/commons/buffer/Buffer;->h(I)I

    move-result p1

    new-array p1, p1, [B

    .line 3
    iget-object v0, p0, Lcom/hierynomus/protocol/commons/buffer/Buffer;->a:[B

    array-length v1, v0

    const/4 v2, 0x0

    invoke-static {v0, v2, p1, v2, v1}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V

    .line 4
    iput-object p1, p0, Lcom/hierynomus/protocol/commons/buffer/Buffer;->a:[B

    :cond_0
    return-void
.end method

.method public b([B)V
    .locals 2
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lcom/hierynomus/protocol/commons/buffer/Buffer$BufferException;
        }
    .end annotation

    .line 5
    array-length v0, p1

    const/4 v1, 0x0

    invoke-virtual {p0, p1, v1, v0}, Lcom/hierynomus/protocol/commons/buffer/Buffer;->b([BII)V

    return-void
.end method

.method public b([BII)V
    .locals 2
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lcom/hierynomus/protocol/commons/buffer/Buffer$BufferException;
        }
    .end annotation

    .line 6
    invoke-virtual {p0, p3}, Lcom/hierynomus/protocol/commons/buffer/Buffer;->a(I)V

    .line 7
    iget-object v0, p0, Lcom/hierynomus/protocol/commons/buffer/Buffer;->a:[B

    iget v1, p0, Lcom/hierynomus/protocol/commons/buffer/Buffer;->c:I

    invoke-static {v0, v1, p1, p2, p3}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V

    .line 8
    iget p1, p0, Lcom/hierynomus/protocol/commons/buffer/Buffer;->c:I

    add-int/2addr p1, p3

    iput p1, p0, Lcom/hierynomus/protocol/commons/buffer/Buffer;->c:I

    return-void
.end method

.method public c()I
    .locals 2

    .line 1
    iget v0, p0, Lcom/hierynomus/protocol/commons/buffer/Buffer;->d:I

    iget v1, p0, Lcom/hierynomus/protocol/commons/buffer/Buffer;->c:I

    sub-int/2addr v0, v1

    return v0
.end method

.method public c(Lcom/hierynomus/protocol/commons/buffer/a;)I
    .locals 0
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lcom/hierynomus/protocol/commons/buffer/Buffer$BufferException;
        }
    .end annotation

    .line 3
    invoke-virtual {p1, p0}, Lcom/hierynomus/protocol/commons/buffer/a;->c(Lcom/hierynomus/protocol/commons/buffer/Buffer;)I

    move-result p1

    return p1
.end method

.method public c(I)Lcom/hierynomus/protocol/commons/buffer/Buffer;
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(I)",
            "Lcom/hierynomus/protocol/commons/buffer/Buffer<",
            "TT;>;"
        }
    .end annotation

    .line 2
    iget-object v0, p0, Lcom/hierynomus/protocol/commons/buffer/Buffer;->b:Lcom/hierynomus/protocol/commons/buffer/a;

    invoke-virtual {p0, p1, v0}, Lcom/hierynomus/protocol/commons/buffer/Buffer;->a(ILcom/hierynomus/protocol/commons/buffer/a;)Lcom/hierynomus/protocol/commons/buffer/Buffer;

    return-object p0
.end method

.method public c(J)Lcom/hierynomus/protocol/commons/buffer/Buffer;
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(J)",
            "Lcom/hierynomus/protocol/commons/buffer/Buffer<",
            "TT;>;"
        }
    .end annotation

    .line 4
    iget-object v0, p0, Lcom/hierynomus/protocol/commons/buffer/Buffer;->b:Lcom/hierynomus/protocol/commons/buffer/a;

    invoke-virtual {p0, p1, p2, v0}, Lcom/hierynomus/protocol/commons/buffer/Buffer;->c(JLcom/hierynomus/protocol/commons/buffer/a;)Lcom/hierynomus/protocol/commons/buffer/Buffer;

    return-object p0
.end method

.method public c(JLcom/hierynomus/protocol/commons/buffer/a;)Lcom/hierynomus/protocol/commons/buffer/Buffer;
    .locals 0
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(J",
            "Lcom/hierynomus/protocol/commons/buffer/a;",
            ")",
            "Lcom/hierynomus/protocol/commons/buffer/Buffer<",
            "TT;>;"
        }
    .end annotation

    .line 5
    invoke-virtual {p3, p0, p1, p2}, Lcom/hierynomus/protocol/commons/buffer/a;->c(Lcom/hierynomus/protocol/commons/buffer/Buffer;J)V

    return-object p0
.end method

.method public d(Lcom/hierynomus/protocol/commons/buffer/a;)J
    .locals 2
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lcom/hierynomus/protocol/commons/buffer/Buffer$BufferException;
        }
    .end annotation

    .line 5
    invoke-virtual {p1, p0}, Lcom/hierynomus/protocol/commons/buffer/a;->d(Lcom/hierynomus/protocol/commons/buffer/Buffer;)J

    move-result-wide v0

    return-wide v0
.end method

.method public d(I)Lcom/hierynomus/protocol/commons/buffer/Buffer;
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(I)",
            "Lcom/hierynomus/protocol/commons/buffer/Buffer<",
            "TT;>;"
        }
    .end annotation

    .line 4
    iget-object v0, p0, Lcom/hierynomus/protocol/commons/buffer/Buffer;->b:Lcom/hierynomus/protocol/commons/buffer/a;

    invoke-virtual {p0, p1, v0}, Lcom/hierynomus/protocol/commons/buffer/Buffer;->b(ILcom/hierynomus/protocol/commons/buffer/a;)Lcom/hierynomus/protocol/commons/buffer/Buffer;

    return-object p0
.end method

.method public d()[B
    .locals 5

    .line 1
    invoke-virtual {p0}, Lcom/hierynomus/protocol/commons/buffer/Buffer;->c()I

    move-result v0

    const/4 v1, 0x0

    if-lez v0, :cond_0

    .line 2
    new-array v2, v0, [B

    .line 3
    iget-object v3, p0, Lcom/hierynomus/protocol/commons/buffer/Buffer;->a:[B

    iget v4, p0, Lcom/hierynomus/protocol/commons/buffer/Buffer;->c:I

    invoke-static {v3, v4, v2, v1, v0}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V

    return-object v2

    :cond_0
    new-array v0, v1, [B

    return-object v0
.end method

.method public e()B
    .locals 3
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lcom/hierynomus/protocol/commons/buffer/Buffer$BufferException;
        }
    .end annotation

    const/4 v0, 0x1

    .line 1
    invoke-virtual {p0, v0}, Lcom/hierynomus/protocol/commons/buffer/Buffer;->a(I)V

    .line 2
    iget-object v0, p0, Lcom/hierynomus/protocol/commons/buffer/Buffer;->a:[B

    iget v1, p0, Lcom/hierynomus/protocol/commons/buffer/Buffer;->c:I

    add-int/lit8 v2, v1, 0x1

    iput v2, p0, Lcom/hierynomus/protocol/commons/buffer/Buffer;->c:I

    aget-byte v0, v0, v1

    return v0
.end method

.method public e(Lcom/hierynomus/protocol/commons/buffer/a;)J
    .locals 2
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lcom/hierynomus/protocol/commons/buffer/Buffer$BufferException;
        }
    .end annotation

    .line 5
    invoke-virtual {p1, p0}, Lcom/hierynomus/protocol/commons/buffer/a;->e(Lcom/hierynomus/protocol/commons/buffer/Buffer;)J

    move-result-wide v0

    return-wide v0
.end method

.method public e(I)[B
    .locals 0
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lcom/hierynomus/protocol/commons/buffer/Buffer$BufferException;
        }
    .end annotation

    .line 3
    new-array p1, p1, [B

    .line 4
    invoke-virtual {p0, p1}, Lcom/hierynomus/protocol/commons/buffer/Buffer;->b([B)V

    return-object p1
.end method

.method public f()J
    .locals 2
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lcom/hierynomus/protocol/commons/buffer/Buffer$BufferException;
        }
    .end annotation

    .line 2
    iget-object v0, p0, Lcom/hierynomus/protocol/commons/buffer/Buffer;->b:Lcom/hierynomus/protocol/commons/buffer/a;

    invoke-virtual {p0, v0}, Lcom/hierynomus/protocol/commons/buffer/Buffer;->a(Lcom/hierynomus/protocol/commons/buffer/a;)J

    move-result-wide v0

    return-wide v0
.end method

.method public f(I)V
    .locals 0

    .line 1
    iput p1, p0, Lcom/hierynomus/protocol/commons/buffer/Buffer;->c:I

    return-void
.end method

.method public g()I
    .locals 1
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lcom/hierynomus/protocol/commons/buffer/Buffer$BufferException;
        }
    .end annotation

    .line 1
    iget-object v0, p0, Lcom/hierynomus/protocol/commons/buffer/Buffer;->b:Lcom/hierynomus/protocol/commons/buffer/a;

    invoke-virtual {p0, v0}, Lcom/hierynomus/protocol/commons/buffer/Buffer;->b(Lcom/hierynomus/protocol/commons/buffer/a;)I

    move-result v0

    return v0
.end method

.method public g(I)Lcom/hierynomus/protocol/commons/buffer/Buffer;
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(I)",
            "Lcom/hierynomus/protocol/commons/buffer/Buffer<",
            "TT;>;"
        }
    .end annotation

    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lcom/hierynomus/protocol/commons/buffer/Buffer$BufferException;
        }
    .end annotation

    .line 2
    invoke-virtual {p0, p1}, Lcom/hierynomus/protocol/commons/buffer/Buffer;->a(I)V

    .line 3
    iget v0, p0, Lcom/hierynomus/protocol/commons/buffer/Buffer;->c:I

    add-int/2addr v0, p1

    iput v0, p0, Lcom/hierynomus/protocol/commons/buffer/Buffer;->c:I

    return-object p0
.end method

.method public h()I
    .locals 1
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lcom/hierynomus/protocol/commons/buffer/Buffer$BufferException;
        }
    .end annotation

    .line 2
    iget-object v0, p0, Lcom/hierynomus/protocol/commons/buffer/Buffer;->b:Lcom/hierynomus/protocol/commons/buffer/a;

    invoke-virtual {p0, v0}, Lcom/hierynomus/protocol/commons/buffer/Buffer;->c(Lcom/hierynomus/protocol/commons/buffer/a;)I

    move-result v0

    return v0
.end method

.method public i()J
    .locals 2
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lcom/hierynomus/protocol/commons/buffer/Buffer$BufferException;
        }
    .end annotation

    .line 1
    iget-object v0, p0, Lcom/hierynomus/protocol/commons/buffer/Buffer;->b:Lcom/hierynomus/protocol/commons/buffer/a;

    invoke-virtual {p0, v0}, Lcom/hierynomus/protocol/commons/buffer/Buffer;->d(Lcom/hierynomus/protocol/commons/buffer/a;)J

    move-result-wide v0

    return-wide v0
.end method

.method public j()I
    .locals 2
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lcom/hierynomus/protocol/commons/buffer/Buffer$BufferException;
        }
    .end annotation

    .line 1
    invoke-virtual {p0}, Lcom/hierynomus/protocol/commons/buffer/Buffer;->i()J

    move-result-wide v0

    long-to-int v1, v0

    return v1
.end method

.method public k()J
    .locals 2
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lcom/hierynomus/protocol/commons/buffer/Buffer$BufferException;
        }
    .end annotation

    .line 1
    iget-object v0, p0, Lcom/hierynomus/protocol/commons/buffer/Buffer;->b:Lcom/hierynomus/protocol/commons/buffer/a;

    invoke-virtual {p0, v0}, Lcom/hierynomus/protocol/commons/buffer/Buffer;->e(Lcom/hierynomus/protocol/commons/buffer/a;)J

    move-result-wide v0

    return-wide v0
.end method

.method public l()I
    .locals 1

    .line 1
    iget v0, p0, Lcom/hierynomus/protocol/commons/buffer/Buffer;->c:I

    return v0
.end method

.method public toString()Ljava/lang/String;
    .locals 2

    .line 1
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    const-string v1, "Buffer [rpos="

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget v1, p0, Lcom/hierynomus/protocol/commons/buffer/Buffer;->c:I

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    const-string v1, ", wpos="

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget v1, p0, Lcom/hierynomus/protocol/commons/buffer/Buffer;->d:I

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    const-string v1, ", size="

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget-object v1, p0, Lcom/hierynomus/protocol/commons/buffer/Buffer;->a:[B

    array-length v1, v1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    const-string v1, "]"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method
